var $utils= {
    formCheck : {
        Required(param) {
            return param.trim().length == 0 ? true : false;
        },
        Email(param) {
            return /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(param.trim()) ? true : false;
        },
        Phone(param) {
            return /^1[23456789]\d{9}$/.test(param.trim()) ? true : false;
        },
        QQ(param) {
            return /^[1-9]\d{4,8}$/.test(param.trim()) ? true : false;
        },
        IdCard(param) {
            return /^\d{15}(\d{2}[A-Za-z0-9])?$/.test(param.trim()) ? true : false;
        },
        IP(param) {
            return /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/.test(param.trim()) ? true : false;
        },
        Verify(param, num = 6) {
            if (param.trim().length == num) {
                return /^[0-9]*$/.test(param.trim()) ? true : false;
            } else {
                return false;
            }
        },
        String(param, min = 0, max = 10000) {
            return (param.trim().length >= min && param.trim().length <= max) ? true : false;
        }
    },
    getQueryString(param){
        var reg = new RegExp('(^|&)' + param + '=([^&]*)(&|$)');
        var r = window.location.search.substr(1).match(reg) || window.location.hash.substring((window.location.hash.search(/\?/)) + 1).match(reg);
        return r != null?decodeURIComponent(r[2]):null;
    }
};
String.prototype.trim = function () {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}